#pragma once

class CheckersApp;
class CheckersBoard;
class CheckersPiece;

#include <DirectXMath.h>
#include "Animation.h"
#include "AlignedAllocationPolicy.h"

class JumpAnimation : public Animation, public AlignedAllocationPolicy<16>
{
	// Constants
	static const float g;

	// Fields
	DirectX::XMVECTOR acceleration;
	CheckersApp *app;
	DirectX::XMVECTOR destination;
	float interval;
	CheckersPiece *piece;
	DirectX::XMVECTOR velocity;

public:
	// Constructor/destructor
	JumpAnimation(CheckersApp *app, CheckersPiece *piece);

	// Setters
	void SetDestination(const DirectX::XMVECTOR &destination) { this->destination = destination; }
	void SetInterval(float interval) { this->interval = interval; }

	// Methods
	void MoveToSquare(CheckersBoard *board, int i, int j);
	void Start();
	void Tick();
};